package com;

import java.util.HashMap;
import java.util.Map;

import org.junit.Ignore;
import org.junit.Test;


public class GeneratorTest {
	//private final static String URL ="jdbc:mysql://123.207.51.13:3306/lichengdu?useUnicode=true&amp;characterEncoding=utf8";
	//private final static String URL ="jdbc:postgresql://123.207.51.13:5432/lichengdu?prepareThreshold=0&binaryTransfer=false";
	private final static String URL ="jdbc:oracle:thin:@39.108.156.196:1521:CRMDB";
	
	
	private final static String FILEPATH ="F:\\upload\\";
	private final static String USERNAME ="crm";
	private final static String PASSWORD ="snimay2017";
	private final static String AUTHOR ="lichengdu";
	private final static String URLPATH ="http://172.16.19.115:8048/files/";
	private final static String PACKAGENAME ="com.snimay";
	
	private final static String SCHEMA="dudu";
	
	private final static String TABLE ="CRM_USER";
	@Test
	public void testOrcale(){
		OracleGenerator oracleGenerator = new OracleGenerator();
		Map<String, Object> dataMap =new HashMap<String, Object>();
		dataMap.put("urlPath", URLPATH);
		dataMap.put("filePath", FILEPATH);
		dataMap.put("url", URL);
		dataMap.put("username", USERNAME);
		dataMap.put("password", PASSWORD);
		dataMap.put("table", TABLE);
		dataMap.put("author", AUTHOR);
		dataMap.put("packageName", PACKAGENAME);
		String urlPath = oracleGenerator.gen(dataMap);
		System.out.println(urlPath);
	}
	@Test
	@Ignore
	public void testMysql(){
		MySQLGenerator mySQLGenerator = new MySQLGenerator();
		Map<String, Object> dataMap =new HashMap<String, Object>();
		dataMap.put("urlPath", URLPATH);
		dataMap.put("filePath", FILEPATH);
		dataMap.put("url", URL);
		dataMap.put("username", USERNAME);
		dataMap.put("password", PASSWORD);
		dataMap.put("table", TABLE);
		dataMap.put("author", AUTHOR);
		dataMap.put("packageName", PACKAGENAME);
		String urlPath = mySQLGenerator.gen(dataMap);
		System.out.println(urlPath);
	}
}
